package com.tool4j.common;

import lombok.Getter;

/**
 * @author Deng.Weiping
 * @since 2023/10/31 11:20
 */
@Getter
public enum RoleEnum {
    USER("普通用户", "0"),
    ADMIN("系统管理员", "666"),
    ;

    private String value;

    private String name;

    public static String getNameByValue(String value) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.getValue().equals(value)) {
                return roleEnum.name();
            }
        }
        return null;
    }

    RoleEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }
}
